
let crypto = require('crypto');
let md5Utils = require('../v1/md5');

function encrypt (content,secret){
    let cipher = crypto.createCipher('aes192', secret);
    let enc = cipher.update(content,'utf8','hex');
    enc += cipher.final('hex');
    // console.log('enc:',enc);
    return enc;
}


function decrypt (content,secret){
    console.log('解密信息.  content:',content,";secret: ",secret);
    let decipher = crypto.createDecipher('aes192',secret);
    let dec = decipher.update(content,'hex','utf8');
    dec += decipher.final('utf8');
    return dec;
}


// console.log(decrypt('ebff787f319b5dcdb82b1ed481fd9e6e','071024'));

// e9c89f1ba53438096ccdea0044bed76b
console.log(md5Utils.hex_md5('071024'));
